//
//  SHThreeImageCell.m
//  UI_CarHome
//
//  Created by dllo on 15/10/22.
//  Copyright (c) 2015年 沈浩. All rights reserved.
//

#import "SHThreeImageCell.h"
#import "SHHandle.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height


@implementation SHThreeImageCell

- (void)dealloc
{
    [_timeLabel release];
    [_leftImageView release];
    [_centerImageView release];
    [_rightImageView release];
    [_titleLabel release];
    [_replycountLabel release];
    [_tushuoLabel release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView
{
 
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.titleLabel];
    [_titleLabel release];
//    _titleLabel.layer.borderWidth = 1;
    self.titleLabel.textColor = TEXTCOLOR;
    
    self.leftImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.leftImageView];
    [_leftImageView release];
//    _leftImageView.layer.borderWidth = 1;
    
    self.centerImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.centerImageView];
    [_centerImageView release];
//    _centerImageView.layer.borderWidth = 1;
    
    self.rightImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.rightImageView];
    [_rightImageView release];
//    _rightImageView.layer.borderWidth = 1;
    
    self.timeLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.timeLabel];
    [_timeLabel release];
//    _timeLabel.layer.borderWidth = 1;
    self.timeLabel.textColor = TEXTCOLOR;
    
    self.tushuoLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.tushuoLabel];
    [_tushuoLabel release];
    
    self.replycountLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.replycountLabel];
    [_replycountLabel release];
    self.replycountLabel.textColor = TEXTCOLOR;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.titleLabel.frame = CGRectMake(5 * WID, 5 * HEI, WIDTH , HEIGHT / 4);
    
    self.leftImageView.frame = CGRectMake(5 * WID, HEIGHT / 4 + 5 * HEI, (WIDTH - 30) / 3, HEIGHT / 2);
    
    self.centerImageView.frame = CGRectMake((WIDTH - 30) / 3 + 10 * WID, 5  + HEIGHT / 4, (WIDTH - 30) / 3, HEIGHT / 2);
    
    self.rightImageView.frame = CGRectMake((WIDTH - 30) / 3 * 2 + 20 * WID, 5 * HEI + HEIGHT / 4, (WIDTH - 30) / 3, HEIGHT / 2);
    
    self.timeLabel.frame = CGRectMake(5 * WID, HEIGHT * 3 / 4 + 5 * HEI, (WIDTH - 30) / 3 * 4 / 5, HEIGHT / 6);
    
    self.tushuoLabel.frame = CGRectMake((WIDTH - 30) * 2 / 3 + 20 * WID, HEIGHT * 3 / 4 + 5 * HEI, (WIDTH - 30) / 6, HEIGHT / 6);
    
    self.replycountLabel.frame = CGRectMake((WIDTH - 30) * 5 / 6 + 20 * WID, HEIGHT * 3 / 4 + 5 * HEI, (WIDTH - 30) / 6, HEIGHT / 6);
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
